package com.bwie.remote;

import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.remote.factory.RemoteSystemServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @className: RemoteSystemService
 * @Description: TODO
 * @version: v1.８.0
 * @author: 李明
 * @date: 2025/10/22 10:12
 */
@FeignClient(value = "bwie-system", fallbackFactory = RemoteSystemServiceFallback.class)
public interface RemoteSystemService {

    /**
     * 根据用户名称和密码查询该用户是否存在
     */
    @GetMapping("user/getUserInfo/{username}")
    public Result<User> getUserInfo(@PathVariable("username") String username);

    /**
     * 根据手机号查询用户信息
     */
    @GetMapping("user/getUserByPhone/{phone}")
    public Result<User> getUserByPhone(@PathVariable("phone") String phone);

    /**
     * 注册用户
     */
    @PostMapping("user/addUserInfo")
    public Result addUserInfo(@RequestBody User user);

}
